Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-598

ThrowableInformation should keep the Throwable cause hierarchy intact.

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 0.9.16
    • None
    • logback-classic
    • None
    • Operating System: All
      Platform: All

    • 136

    Description

      Instead of a String representation of the whole Throwable stack trace incl. cause ThrowableInformation should instead look like this:

      public class ThrowableInformation implements Serializable
      {
      String throwableClassName;
      String message;
      StackTraceElement[] stackTrace;
      ThrowableInformation cause;
      }

      I omitted get/set and private in this example.

      StackTraceElement is perfectly Serializable and did also receive a public c'tor in Java 5 so I guess that the current ThrowableInformation is more or less a relict of log4j which had to stay compatible with older Java versions.

      You could obviously keep the getThrowableStrRep() method for compatibility.

      This bug is somewhat related to LBCLASSIC-45 because I think that ThrowableInformation should also, as LoggingEvent, be just a dumb data container with no real logic.

      The logic to extract the relevant StackTraceElements should IMHO be moved either into Logger or into a static factory method of ThrowableInformation.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            joern@huxhorn.de Joern Huxhorn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: